package org.jflame.fx.converter;

import javafx.util.converter.IntegerStringConverter;

public class SafeIntegerStringConverter extends IntegerStringConverter {

    @Override
    public Integer fromString(String value) {
        if (value == null) {
            return null;
        }
        value = value.trim();

        try {
            return Integer.valueOf(value);
        } catch (NumberFormatException e) {
            return null;// 不可转换，不抛异常
        }

    }

}
